﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hospital.Model.entity
{
    [SugarTable("PurchaseDetail")]
    public class PurchaseDetail : BaseId
    {
        [SugarColumn(IsNullable = false)]
        public long OrderId { get; set; } // 采购单ID

        [SugarColumn(IsNullable = false)]
        public long MedicineId { get; set; } // 药品ID

        [SugarColumn(IsNullable = false)]
        public int Quantity { get; set; } // 采购数量

        [SugarColumn(DecimalDigits = 2, IsNullable = false)]
        public decimal UnitPrice { get; set; } // 采购单价

        [SugarColumn(DecimalDigits = 2, IsNullable = false)]
        public decimal Subtotal { get; set; } // 小计（Quantity * UnitPrice）

        [Navigate(NavigateType.OneToOne, nameof(MedicineId))]
        public Medicine Medicine { get; set; } // 关联药品信息
    }
}
